<?php
class ControllerAffiliateLogout extends FrontController {
	public function index() {
    	if ($this->affiliate->isLogged()) {
      		$this->affiliate->logout();
      		$this->redirect(US('affiliate/logout'));
    	}

		$this->document->setTitle($this->_['heading_title']);

		$this->data['breadcrumbs'][] = array(
        	'text'      => $this->_['text_account'],
			'href'      => US('affiliate/account'),
        	'separator' => $this->_['text_separator']
      	);

      	$this->data['breadcrumbs'][] = array(
        	'text'      => $this->_['text_logout'],
			'href'      => US('affiliate/logout'),
        	'separator' => $this->_['text_separator']
      	);

    	$this->data['heading_title'] = $this->_['heading_title'];
    	$this->data['text_message'] = $this->_['text_message'];
    	$this->data['continue'] = HTTP_SERVER;

		$this->display('common/success.tpl');
  	}
}
?>